package com.hr.system.util;

import org.springframework.beans.BeanUtils;

public class EntityConvertUtil {

    /**
     * 转换 */
    public static <T> T convert(Object obj,Class<T> clz){
        try {
            T t = clz.newInstance();
            BeanUtils.copyProperties(obj,t);
            return t;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
